﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using HFController;
using System.Web.Script.Serialization;
using System.Web.SessionState;
namespace HFWebApp.AjaxSource
{
    /// <summary>
    /// AddWanted 的摘要说明
    /// </summary>
    public class AddWanted : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            BagePages bp = new BagePages();
            context.Response.ContentType = "text/plain";
            string names = bp.GetAll("names"); //$("#names");
            string sex = bp.GetAll("sex"); //$("#sex"); 
            string marriage = bp.GetAll("marriage"); //$("#marriage"); 
            string height = bp.GetAll("height"); //$("#height"); 
            string school = bp.GetAll("school"); //$("#school"); 
            string specialty = bp.GetAll("specialty"); //$("#specialty"); 
            string academic = bp.GetAll("academic"); //$("#academic"); 
            string language = bp.GetAll("language"); //$("#language"); 
            string computer = bp.GetAll("computer"); //$("#computer"); 
            string isexamination = bp.GetAll("isexamination"); //$("#isexamination");
            string phone = bp.GetAll("phone"); //$("#phone");
            string personweb = bp.GetAll("personweb"); //$("#personweb"); 
            string accountplace = bp.GetAll("accountplace"); //$("#accountplace"); 
            string nowplace = bp.GetAll("nowplace"); //$("#nowplace"); 
            string addr = bp.GetAll("addr"); //$("#addr");
            string jobsid = bp.GetAll("jobsid"); //$("#jobsid");
            string provinceid = bp.GetAll("provinceid"); //$("#provinceid");
            string cityid = bp.GetAll("cityid"); //$("#cityid");
            string treatment = bp.GetAll("treatment"); //$("#treatment"); 
            string personinfo = bp.GetAll("personinfo"); //$("#personinfo"); 
            string workexe = bp.GetAll("workexe"); //$("#workexe"); 

            HFModel.ResultModel result = JobsController.getController().doAddWanted(names, sex, marriage, height, school, specialty, academic, language, computer, isexamination, phone, personweb, accountplace, nowplace, addr, jobsid, provinceid, cityid, treatment, personinfo, workexe);
            context.Response.Write(this.getJSONResult(result));
            context.Response.End();
        }

        protected string getJSONResult(HFModel.ResultModel result)
        {
            JavaScriptSerializer jsSerializer = new JavaScriptSerializer(new SimpleTypeResolver());
            return jsSerializer.Serialize(result);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}